
package controllers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import views.MenuGUI;

public class MenuController {
    
	private MenuGUI menuGUI;
	
	public static void main(String[] args) {
    	new MenuController();
    }

    public MenuController() {
		menuGUI = new MenuGUI();
		menuGUI.setListener(new VMenuListener());
		menuGUI.setVisible(true);
	}

	class VMenuListener implements ActionListener{
		@Override
		public void actionPerformed(ActionEvent e) {
			Object btn = e.getSource();
			if(btn == menuGUI.btEntrar){
				new EntrarController(menuGUI);
				menuGUI.setVisible(false);
			}
			if(btn == menuGUI.btCriar){
				new CriarController(menuGUI);
				menuGUI.setVisible(false);				
			}
			if(btn == menuGUI.btSair){
				System.exit(0);
			}
		}
		
	}
	
}
